package router

import (
	"app/api/handler/ws"
	"app/api/middleware"
	"app/api/router/admin"
	"app/api/router/supplier"
	"github.com/gin-gonic/gin"
)

// 全局总路由
func Router(engine *gin.Engine) {
	//使用跨域中间件
	engine.Use(middleware.Cors)

	//supplier组织
	supplier.Router(engine.Group("/supplier"))

	//admin组织
	admin.Router(engine.Group("/admin"))

	//ws
	engine.GET("/ws", ws.HandleConnections)
}
